package top.zy.service.zymallgoodsinterface.api;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.zy.common.zymallcommon.vo.PageResult;
import top.zy.service.zymallgoodsinterface.dto.BrandPageParam;
import top.zy.service.zymallgoodsinterface.entity.Brand;

import java.util.List;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 14:37 2019/7/2
 */
public interface BrandApi {
    /**
     * 分页查询品牌
     * @param brandPageParam
     * @return
     */
    @GetMapping("brand/page")
     PageResult<Brand> queryBrandPage(BrandPageParam brandPageParam);

    /***
     *新增品牌信息
     * @param brand
     * @param cids
     */
    @PostMapping("brand/add")
     void saveBrand(Brand brand,@RequestParam("cids") List<Long> cids);

    /***
     * 根据分了id查询品牌
     * @param id
     * @return
     */
    @GetMapping("brand/cid/{id}")
     List<Brand> queryBrandListByCategoryId(@PathVariable("id") Long id);

    /***
     * 根据品牌id查询品牌
     * @param id
     * @return
     */
    @GetMapping("brand/{id}")
     Brand queryBrandById(@PathVariable("id")Long id);

    @GetMapping("brand/list")
    List<Brand> queryBrandByIds(@RequestParam("ids")List<Long> ids);
}
